<?php
class indexAction extends rareAction{
	public function	execute(){
		
	}
	public function executePost(){
		$username = $this->getPostParam('username','');
		$passwd = md5($this->getPostParam('passwd',''));
		if($username=='') redirect('login');
		$admin = new DaoAdmin();
		$user = $admin->getOne(" name='$username' and passwd='$passwd'");
		if(empty($user)) redirect('login');
		Tool::_setSession('userID',$user['id']);
		Tool::_setSession('userName',$user['name']);
		Tool::_setSession('passwd',$user['passwd']);
		redirect('index');
	}
}
?>
